<template>
  <view class="nodata">
    <image
      :src="baseImg"
      mode="widthFix"
      class="empty_image"
      :style="{
        marginBottom: spacing + 'rpx',
      }"
    ></image>
    <view class="empty-title">
      <text
        :style="{
          color: textColor,
          fontSize: fontSize + 'rpx',
          fontWeight: fontWeight,
        }"
        @click="handleTitleClick"
        >{{ text }}</text
      >
    </view>
    <view class="empty-label">
      <text>{{ label }}</text>
    </view>
    <slot></slot>
  </view>
</template>

<script>
export default {
  props: {
    //text
    baseImg: {
      type: String,
      default: "https://img3.job1001.com/ypMp/elan/images/common/empty.png",
    },
    text: {
      type: String,
      default: "",
    },
    fontSize: {
      type: [String, Number],
      default: "32",
    },
    fontWeight: {
      type: [String, Number],
      default: "bold",
    },
    fontWeight: {
      type: [String, Number],
      default: "bold",
    },
    textColor: {
      type: String,
      default: "#000",
    },
    label: {
      type: String,
      default: "",
    },
    spacing: {
      type: [String, Number],
      default: "50",
    },
  },
  methods: {
    handleTitleClick() {
      this.$emit("titleClick");
    },
  },
};
</script>

<style lang="scss">
.nodata {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  align-items: center;
  color: #666;
  font-size: $uni-font-size-base;
}
.empty_image {
  width: 378rpx;
  height: 306rpx;
  margin-bottom: 50rpx;
}
.empty-title {
  margin-bottom: $uni-spacing-col-base;
  font-size: $uni-font-size-lg;
  font-weight: bold;
}
</style>
